package com.cabinet;

/**
* Created with IntelliJ IDEA.
* User: lesya
* Date: 1/18/14
* Time: 12:07 PM
* To change this template use File | Settings | File Templates.
*/
class InPacket {
  byte[] data = new byte[16];

  void logInData(){
    boolean all0=true;
    for( int i=0; i<data.length; i++ ){
      if( data[i] != 0 ){
        all0 = false;
      }
    }
    if( all0 ){
      System.out.println("InPacket "+data.length+" bytes 0");
    }else{
      for( int i=0; i<data.length; i++ ){
        System.out.println("InPacket byte "+String.format("%2d",i)+" = "+
            SendReceiveThread.binaryVal(data[i]));
      }
    }
  }

  boolean hasCall(){
    for( byte b : data ){
      if( (b & 0b1000_0000) != 0 ){
        return true;
      }
    }
    return false;
  }
}
